package uk.co.q3c.deplan.server.util.validation;

import java.util.ArrayList;
import java.util.List;

/**
 * Validation result relating to a single property - although there may have
 * been multiple rules applied, which is why there are potentially mulitple
 * error messages
 * 
 * @author DSowerby 23 Apr 2009
 * 
 */
public class ValidationResult {
	private final List<String> errorMessages;
	private boolean valid;

	public ValidationResult() {
		super();
		errorMessages = new ArrayList<String>();
	}

	public boolean isValid() {
		return valid;
	}

	public void setValid(boolean valid) {
		this.valid = valid;
	}

	public List<String> errorMessages() {
		return errorMessages;
	}

	public void addValidationMessage(String msg) {
		errorMessages.add(msg);

	}

	public boolean isNotValid() {
		return !valid;
	}
}
